package com.itheima.user.controller;

import com.itheima.common.vo.LoginUserVo;
import com.itheima.common.vo.ResultVo;
import com.itheima.user.dto.LoginDto;
import com.itheima.user.service.ApUserService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @version 1.0
 * @description 说明
 * @package com.itheima.user.controller
 */
@RestController
@RequestMapping("/login")
public class LoginController {

    @Resource
    private ApUserService apUserService;

    /**
     * App端用户登录校验
     * @param dto
     * @return
     */
    @PostMapping("/login_auth")
    public ResultVo<LoginUserVo> loginCheck(@RequestBody LoginDto dto){
        LoginUserVo vo = apUserService.loginCheck(dto);
        return ResultVo.ok(vo);
    }
}
